/**
 * 
 */
package org.istt.service;

import java.io.Serializable;
import java.util.List;

import org.istt.web.helper.ExtendedPaginatedList;

/**
 * @author Huy
 *
 */
public interface Manager<T, ID extends Serializable> {
	public List<T> getList();
	public ExtendedPaginatedList getList(ExtendedPaginatedList paginatedList);
    public T get(ID id);
    public void save(T t);
    
    public T insert(T t); //Updated on 30.7.2012 by NDTHO
    
    public void remove(ID id);
    public List<T> search(T t, String... excludeProperty);
    
    /**
     * Whether fields is unique
     * @param fields fields which has unique constraint
     * @param value value of each field
     * @param id primary key
     * @return <code>true</code> if valid for unique constraint otherwise <code>false</code>
     */
    boolean isUnique(String[] fields, String[] value, ID id);
}
